home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1995 April / Internet Tools.iso / mail / listserv / utils / add_list.sh.Z / add_list.sh
Encoding:
Linux/UNIX/POSIX Shell Script  |  1994-05-04  |  3.0 KB  |  99 lines

  1. #!/bin/sh
  2. ##########################################################################
  3. #                                                                        #
  4. #                                                                        #
  5. # This script is for adding lists to Listserv 6.0b, though it may work   #
  6. # for other lists.  It is also intended to work with NCSU's sendmail.cf  #
  7. # which requires the listserv.addresses file.                            #
  8. #                                                                        #
  9. # Written by djbarnes@tx.ncsu.edu on 3/29/94                             #
  10. # Feel free to redistribute if you can use it!                           #
  11. #                                                                        #
  12. #                                                                        #
  13. ##########################################################################
  14.  
  15.  
  16. # Determine how echo suppresses new-line
  17. echo "a\c" > /tmp/echo
  18. if [ "`grep c /tmp/echo`" = "a\c" ]; then
  19.   n='-n'
  20.   c=''
  21. else
  22.   n=''
  23.   c='\c'
  24. fi
  25. rm /tmp/echo
  26.  
  27. echo "******************************************************************"
  28. echo "This script is used to add lists to the current listserv database."
  29. echo "******************************************************************"
  30. echo ""
  31. echo "This script modifies the following files:"
  32. echo "./owners -- the file that names the owners of each list"
  33. echo "./config -- the config file for listserv"
  34. echo "./listserv.addresses -- the file that sendmail.cf uses to find the addresses"
  35. echo
  36. echo
  37. echo
  38.  
  39.  
  40. echo $n "Please enter the name of the list to be added: $c"
  41. read name
  42.  
  43. echo $n "Please enter the email address of the list owner: $c"
  44. read owner
  45.  
  46. echo $n "Please enter a password for the list (no white space, please): $c"
  47. read password
  48.  
  49. echo "Please enter a one line comment for the list: "
  50. read comment
  51.  
  52. echo
  53. echo "The name of the list you entered is: " $name
  54. echo "The email address of the list owner is: " $owner
  55. echo "The password you entered is: " $password
  56. echo "and the comment you entered is: " $comment
  57. echo
  58.  
  59.  
  60. echo $n "Are you sure you want to make those additions? [y] $c"
  61. read y
  62.  
  63. if [ "$y" = "n" -o "$y" = "N" ]; then
  64.   echo "Nothing changed.  Please Re-run the addlist script to make changes."
  65.   exit 0
  66. else
  67.   echo "Making changes...."
  68. fi
  69.  
  70. # This line takes care of the owners file
  71. echo $owner $name "CCERRORS CCLISTS" >> owners
  72.  
  73. # This line takes care of the listserv.addresses file
  74. echo $name >> listserv.addresses
  75.  
  76. # The rest of this is for the config file
  77. echo "" >> config
  78. echo "#" >> config
  79. echo "#    "$comment >> config
  80. echo "#" >> config
  81. echo "list        "$name $name"@tx.ncsu.edu" $owner $password "-P -s -p -m 25" >> config
  82. echo "comment        "$name "#"$comment >> config
  83.  
  84. echo "List addition complete."
  85. echo "Would you like to restart listserv so that the changes take effect?"
  86. echo $n "[y] $c"
  87. read x
  88.  
  89. if [ "$x" = "n" -o "$x" = "N" ]; then
  90.   echo "Please remember, you must restart listserv for the changes to take effect."
  91.   exit 0
  92. else
  93.   start_listserv
  94. fi
  95.  
  96. exit 0
  97.  
  98.  
  99.